class Solution {
    const char* numStrArr[10] = { "","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz" };
public:

    void Combine(const string& digits, int i, string combineStr, vector<string>& ret)
    {
        if (i == digits.size())
        {
            ret.push_back(combineStr);
            return;
        }
        int num = digits[i] - '0';
        string s = numStrArr[num];
        for (auto ch : s)
        {
            Combine(digits, i + 1, combineStr + ch, ret);
        }
    }

    vector<string> letterCombinations(const string& digits) {
        vector<string> v;

        if (digits.empty())
        {
            return v;
        }

        string str;
        Combine(digits, 0, str, v);
        return v;
    }
};